<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<%
	request.setAttribute("modelConfigPath", "stock");
%>
<%@ include file="/WEB-INF/views/shared/master/contentHeader.jsp"%>
<style >
	#area{
		height:280px;
		width:730px;
		overflow-y:auto; 
		overflow-x:hidden; 
	}
</style>
	
<t:panel cssClass="panel-flat form-detailed" customBody="true" customHead="true">
	<div class="detailed-navbar-content panel-body">
		<input type="hidden" value='${stockJson}' id="stockJson" />
		<t:form modelAttribute="stock" action="/stock/stock/save" method="post" cssClass="form-horizontal">
			<div class="hide">
				 <t:hidden path="stockId"/>
 				 <t:hidden path="deleteMark"/>	
 				 <t:hidden path="createUserName"/>
		 		 <t:hidden path="createUserId"/>
		 		 <t:hidden path="createDate"/>
		 		 <t:hidden path="shopId"/>
			</div>
            <t:formgroup>
            	<t:label path="cargo.cargoName" cssClass="col-sm-1 col-xs-1" />
                <t:input path="cargo.cargoName" colClass="col-sm-2 col-xs-2" />
                <t:label path="cargo.cargoNo" cssClass="col-sm-1 col-xs-1" />
                <t:input path="cargo.cargoNo" colClass="col-sm-2 col-xs-2" />
                <t:label path="stockNum" cssClass="col-sm-1 col-xs-1" />
                <t:input path="stockNum" colClass="col-sm-2 col-xs-2" />
                
                <t:label path="comment" cssClass="col-sm-1 col-xs-1" />
                <t:input path="comment" colClass="col-sm-2 col-xs-2" />
            </t:formgroup>
            <div id="area">
            <table  class="cntable table table-bordered dataTable table-billing">
	            <thead>
	            	<th style="width:50px">序号</th>
	            	<th style="width:50px">规格</th>
	            	<th style="width:55px">库存</th>
	            	
	            </thead>
	            
	            <tbody id="outStockInfo">
					<c:forEach var="stockCollocation" items="${stock.stockCollocations}" varStatus="status">
						<tr>					
			            	<td>${status.index+1}</td>
			            	<td><input style="ime-mode:disabled" disabled="disabled"  name="propertyName" type="text" value="${stockCollocation.collocation.propertyNameOne}/${stockCollocation.collocation.propertyNameTwo}"/></td>
							<td><input style="ime-mode:disabled" disabled="disabled"  name="collocationNum" type="text" value="${stockCollocation.collocationNum}"/></td>
						</tr>
					</c:forEach>
				</tbody>
            </table>
			</div>
		</t:form>
	</div>
</t:panel>

<script type="text/javascript">
/* $(function(){
	if(!$.isNull($("#stockJson").val())){
		var stock =JSON.parse($("#stockJson").val());
		$('#cargoName').val(stock.cargo.cargoName);
		$('#cargoNo').val(stock.cargo.cargoNo);
	}
} */

function saveData(lBtn){
	if (!$("form:first").valid()){
		return;
	}
	lBtn.start();
	$("form:first").submit();
}	


</script>
<%@ include file="/WEB-INF/views/shared/base/scripts/jqueryui.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formtags.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formbuttons.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formpickers.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formselects.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formstyling.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/dialog.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/contentFooter.jsp"%>
